<meta charset="UTF-8">
<style>
th{
	text-align:center
}
td{
	text-align:center
}
</style>
<div class="content-wrapper" style="min-height: 901px;">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1 style="text-align:center">
        	账单查询
      </h1>
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="row">
        <div class="col-md-12">
          <div class="box">
          <div class="box-header">
          	<div style="width: 70%;">
          		<div class="col-md-3 btn-group">
			 	<select class="btn btn-default" style="width: 100%;" >
			 		<option value="全部食堂">全部食堂</option>
			 		<option ng-repeat="c in canteens" value="c.id">{{c.name}}</option>
			 	</select>
			 </div>
			 <div class="col-md-3 btn-group">
			 	<select class="btn btn-default" style="width: 100%;" >
			 		<option value="全部食堂">全部部门</option>
			 		<option ng-repeat="c in canteens" value="c.id">{{c.name}}</option>
			 	</select>
			 </div>
			 <div class="col-md-2 btn-group">
			 	<select class="btn btn-default" style="width: 100%;" ng-model="searchBillBy.canteen">
			 		<option value="全部食堂">全部餐别</option>
			 		<option ng-repeat="c in canteens" value="c.id">{{c.name}}</option>
			 	</select>
			 </div>
			 <div class='col-md-4'>
			 	<input type="text" class="form-control" id="reservation" ng-model="billDate">
			 </div>
			 <div class='col-md-3 pdtop'>
			 	<input type="text" class="form-control" placeholder="用户信息" ng-model="searchBillBy.user_information">
			 </div>
			 <div class='col-md-3 pdtop'>
			 	<input type="text" class="form-control" placeholder="用户卡号" ng-model="searchBillBy.user_card">
			 </div>
			 <div class="col-md-2 btn-group pdtop">
			 	<select class="btn btn-default" style="width: 100%;" ng-model="searchBillBy.bill_type">
			 		<option value="全部单据">全部单据</option>
			 		<option value="食堂消费">食堂消费</option>
			 		<option value="预订消费">预订消费</option>
			 		<option value="外卖消费">外卖消费</option>
			 	</select>
			 </div>
			 <div class="col-md-2 btn-group pdtop">
			 	<select class="btn btn-default" style="width: 100%;" ng-model="searchBillBy.payment">
			 		<option value="全部付款方式">全部付款方式</option>
			 		<option value="餐卡">餐卡</option>
			 		<option value="微信">微信</option>
			 		<option value="支付宝">支付宝</option>
			 	</select>
			 </div>
			 <div class="col-md-2 btn-group pdtop">
			 	<select class="btn btn-default" style="width: 100%;" ng-model="searchBillBy.query_terms">
			 		<option value="按单头">按单头</option>
			 		<option value="按流水">按流水</option>
			 	</select>
			 </div>
			 
          	</div>
             <button class="btn btn-default" ng-click="searchBillData();">查询</button>
          	 <button class="btn pull-right" ng-click="download('tb_billData','账单')"><i class="fa fa-cloud-download"></i>&nbsp;&nbsp;导出</button>
          </div>
            <div class="box-body table-responsive no-padding">
              <table class="table table-hover" >
                <tbody>
                 <tr>
                 	<td style="width:120px" ng-repeat="x in billHeader">{{x}}</td>
                 </tr>
                 <tr ng-repeat="bill in items">
                 	<td>{{bill.bill_id}}</td>
                 	<td>{{bill.bill_time}}</td>
                 	<td>{{bill.username}}</td>
                 	<td>{{bill.telephone}}</td>
                 	<td>{{bill.department_name}}</td>
                 	<td>{{bill.card_id}}</td>
                 	<td>{{bill.card_name}}</td>
                 	<td>{{bill.canteen}}</td>
                 	<td>{{bill.food_time}}</td>
                 	<td>{{bill.receivables}}</td>
                 	<td>{{bill.discount}}</td>
                 	<td>{{bill.consumption}}</td>
                 	<td>{{bill.payment}}</td>
                 	<td>{{bill.payment_amount}}</td>
                 	<td>{{bill.recharge_use}}</td>
                 	<td>{{bill.subsidy_use}}</td>
                 	<td>{{bill.payment_time}}</td>
                 	<td>{{bill.remark}}</td>
                 	<td ng-bind="bill.chargeback==true?'是':'否'"></td>
                 	<td>{{bill.chargeback_bill}}</td>
                 	<td>{{bill.reserve_bill}}</td>
                 	<td>{{bill.bill_type}}</td>
                 	<td>{{bill.operator}}</td>
                 	<td>{{bill.operating_time}}</td>
                 </tr>
                </tbody>
			</table>
			<table class="table table-hover download" id="tb_billData" >
                <tbody>
                 <tr>
                 	<td style="width:120px" ng-repeat="x in billHeader">{{x}}</td>
                 </tr>
                 <tr ng-repeat="bill in billData">
                 	<td>{{bill.bill_id}}</td>
                 	<td>{{bill.bill_time}}</td>
                 	<td>{{bill.username}}</td>
                 	<td>{{bill.telephone}}</td>
                 	<td>{{bill.department_name}}</td>
                 	<td>{{bill.card_id}}</td>
                 	<td>{{bill.card_name}}</td>
                 	<td>{{bill.canteen}}</td>
                 	<td>{{bill.food_time}}</td>
                 	<td>{{bill.receivables}}</td>
                 	<td>{{bill.discount}}</td>
                 	<td>{{bill.consumption}}</td>
                 	<td>{{bill.payment}}</td>
                 	<td>{{bill.payment_amount}}</td>
                 	<td>{{bill.recharge_use}}</td>
                 	<td>{{bill.subsidy_use}}</td>
                 	<td>{{bill.payment_time}}</td>
                 	<td>{{bill.remark}}</td>
                 	<td ng-bind="bill.chargeback==true?'是':'否'"></td>
                 	<td>{{bill.chargeback_bill}}</td>
                 	<td>{{bill.reserve_bill}}</td>
                 	<td>{{bill.bill_type}}</td>
                 	<td>{{bill.operator}}</td>
                 	<td>{{bill.operating_time}}</td>
                 </tr>
                </tbody>
			</table>
		</div>
            <!-- /.box-body -->
          <div class="box-footer" style="margin-bottom:10px;">
	              	
	              		<div class="dataTables_info col-sm-2" id="example1_info" role="status" aria-live="polite">总条目数：{{totalNums}}</div>
	              	
	               
	                	
	                		<label class="col-md-2" style="font-weight:normal;float:left;padding-right:15px;">每页显示数目 
	                			
	                		</label>
	                		<div class="col-md-2">
	                			
	                		
	                		<select name="example1_length" aria-controls="example1" class="form-control input-sm" ng-change="change(initial)" ng-model="initial" > 
	                				<option value="10">10</option> 
	                				<option value="25">25</option>
	                				<option value="50">50</option>
	                				<option value="100">100</option>
	                		    </select>
	                		</div>
	                		<div class="col-md-6">
	                			<ul class="pagination pull-right" style="margin: 0px;">
		                			<li class="paginate_button previous" id="example1_previous">
		                				<a  ng-click="Previous()">上一页</a>
		                			</li>
		                			<li   ng-repeat="page in pageList" ng-class="{active: isActivePage(page)}"><!-- class=" paginate_button active" -->
		                				<a  ng-click="selectPage(page)">{{page}}</a>
		                			</li>
		                			<li class="paginate_button next" id="example1_next">
		                				<a  ng-click="Next()">下一页</a>
		                			</li>
	                		</ul>
	                		</div>
	                		
	                	
	                
	              </div>
          </div>
          <!-- /.box -->
        </div>
      </div>
    </section>
    <!-- /.content -->
  </div>
